using System.Linq;
using Toast.Core;
using Toast.Core.Interfaces;
using Toast.Extensions;

namespace Toast.ContentTypes
{
    public class MultipleContent
    {
        public static ContentCollection UsingWildCardSearch(string path)
        {
            return WildCardFileMatcher.GetMatches(path).Select(x => Content.From(x)).ToScriptCollection();
        }

        public static ContentCollection UsingWildCardSearch(string path, InjectAt injectAt)
        {
            return WildCardFileMatcher.GetMatches(path).Select(x => Content.From(x, injectAt)).ToScriptCollection();
        }

        public static ContentCollection UsingWildCardSearch(string path, ICompressionStrategy javaScriptCompression)
        {
            return WildCardFileMatcher.GetMatches(path).Select(x => Content.From(x, InjectAt.Default, javaScriptCompression)).ToScriptCollection();
        }

        public static ContentCollection UsingWildCardSearch(string path, InjectAt injectAt, ICompressionStrategy javaScriptCompression)
        {
            return WildCardFileMatcher.GetMatches(path).Select(x => Content.From(x, injectAt, javaScriptCompression)).ToScriptCollection();
        }
    }
}